package com.esp.studentManagementSystem.pojo.po.entity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;
import java.util.Set;


@Entity
@Table(name = "sys_user")
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class SysUser{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer userId; // 用户ID

    @NotBlank(message = "用户名不能为空")
    @Size(max = 255)
    @Column(name = "username", nullable = false)
    private String username; // 登陆名

    @NotBlank(message = "密码不能为空")
    @Size(max = 255)
    @Column(name = "password", nullable = false)
    private String password; // 密码

    @Size(max = 255)
    @Column(name = "sex")
    private String sex; // 性别

    @Size(max = 255)
    @Column(name = "address")
    private String address; // 地址

    @Column(name = "enabled", nullable = false)
    private Boolean enabled; // 是否启动账户：true（1）启用，false（0）禁用，默认启用

    @Column(name = "account_no_expired", nullable = false)
    private Boolean accountNotExpired; // 账户是否没有过期：true（1）正常，false（0）已过期，默认正常

    @Column(name = "credentials_no_expired", nullable = false)
    private Boolean credentialsNotExpired; // 密码是否没有过期：true（1）正常，false（0）已过期，默认正常

    @Column(name = "account_no_locked", nullable = false)
    private Boolean accountNotLocked; // 账户是否没有锁定：true（1）正常，false（0）已锁定，默认正常

}
